%
% Author: Vasyl Mykhalchuk
% 01/02/2012
%
function [neighbors, numN] = getNeighbors(xAdjVertList, u)

neighborsRaw = xAdjVertList(u, :);
n = size(neighborsRaw, 2);
numberOfNonZero = 0;

for i = 1:n
    next = neighborsRaw(i);
    if ( next ~= 0 )
        numberOfNonZero = numberOfNonZero + 1;
    else
        i = n + 1;
    end % if
end % for

neighbors = neighborsRaw(1:numberOfNonZero);
numN = numberOfNonZero;

end % function

